package vip.xiaonuo.client.modular.banner.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.xiaonuo.biz.modular.banner.result.BizBannerListResult;
import vip.xiaonuo.biz.modular.banner.service.BizBannerService;
import vip.xiaonuo.common.pojo.CommonResult;

import javax.annotation.Resource;
import java.util.List;

/**
 * 前端Banner控制器
 *
 * @author SNOWY_TEAM
 **/
@Api(tags = "前端Banner接口")
@RestController
@Validated
@RequestMapping("/client/banner")
public class BannerController {

    @Resource
    private BizBannerService bizBannerService;

    /**
     * 获取已启用的Banner列表
     *
     * @return Banner列表
     */
    @ApiOperation("获取已启用的Banner列表")
    @GetMapping("/list")
    public CommonResult<List<BizBannerListResult>> list() {
        return CommonResult.data(bizBannerService.getEnabledBannerList());
    }
} 